package com.zz.art;

import java.util.ArrayList;

import org.newdawn.slick.Animation;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;

public abstract class Art {
	
	public static Image bg;
	public static Image pic;
	public static Image pic2;
	public static Image startButton;
	public static Image exitButton;
	public static Image player;
	public static Image floorTile;
	public static Image wallTile;
	public static Image cursor;
	
	public static ArrayList<Animation> players = new ArrayList<Animation>();
	
	public static void loadImages() throws SlickException {
		
		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 6; j++) {
				Animation a = new Animation();
				for(int k = 0; k < 3; k++) {
					a.addFrame(new Image("res/Players.png").getSubImage(k * 32 + i * 96, j * 32, 32, 32), 350);
				}
				players.add(j, a);
			}
			
		}
		cursor = new Image("res/cursor.png");
		//player = new Image("res/player.png");
		bg = new Image("res/bg.png");
		startButton = new Image("res/buttons.png").getSubImage(0, 0, 128, 24);
		exitButton = new Image("res/buttons.png").getSubImage(128, 0, 128, 24);
		
		//tiles
		floorTile = new Image("res/tile1.png");
		wallTile = new Image("res/walls.png");
	}
	
	public static Image getWallImage(int n){
		switch(n) {
			case(0)	  : return wallTile.getSubImage(0, 0, 32, 32);
			case(1)   : return wallTile.getSubImage(32, 128, 32, 32);
			case(10)  : return wallTile.getSubImage(64, 0, 32, 32);
			case(100) : return wallTile.getSubImage(96, 0, 32, 32);
			case(1000): return wallTile.getSubImage(32, 32, 32, 32);
			case(11)  : return wallTile.getSubImage(160, 0, 32, 32);
			case(101) : return wallTile.getSubImage(0, 32, 32, 32);
			case(1001): return wallTile.getSubImage(32, 160, 32, 32);
			case(110) : return wallTile.getSubImage(64, 32, 32, 32);
			case(1010): return wallTile.getSubImage(96, 32, 32, 32);
			case(1100): return wallTile.getSubImage(128, 32, 32, 32);
			case(111) : return wallTile.getSubImage(160, 32, 32, 32);
			case(1011): return wallTile.getSubImage(0, 64, 32, 32);
			case(1101):	return wallTile.getSubImage(32, 64, 32, 32);
			case(1110): return wallTile.getSubImage(64, 64, 32, 32);
			case(1111): return wallTile.getSubImage(96, 64, 32, 32);
		}
		
		return wallTile.getSubImage(160, 96, 32, 32);
	}

}
